<?php $auth = Am_Di::getInstance()->auth; ?>
<?php if ($auth->getUserId()): // authorized ?>
You are logged-in as <strong><span class="username"><?php p($auth->getUsername()) ?></span></strong>.
<a href="<?php echo REL_ROOT_URL ?>/logout?amember_redirect_url=<?php /*@todo http://hostname/*/p($this->url())?>"><?php __e("Logout")?></a>
<?php else: // not authorized yet?>
<form method="post" action="<?php $this->pUrl('login', 'index', 'default')?>" id="cart-login">
    <div><label for="login">
        <?php __e("Username")?></label>
        <input type="text" name="amember_login" id="login" value="<?php p(@$_REQUEST['login'])?>" />
    </div>
    <br />
    <div><label for="pass">
        <?php __e("Password")?></label>
        <input type="password" name="amember_pass" id="pass" />
    </div>
    <br />
    <input type="hidden" name="amember_redirect_url" value="<?php p($this->url())?>" />
    <input type="hidden" name="saved_form" value="cart" />
    <input type="submit" value="<?php __e("Login")?>"/>
    <input type="button" value="<?php __e("Register")?>" onclick="window.location='<?php p(ROOT_SURL.'/signup/index/c/cart')?>'"/>
</form>
<script type="text/javascript">
$(function(){
    $("#cart-login").amAjaxLoginForm(function(){ window.location.reload(true); });
});
</script>
<?php endif ?>